package cn.e3mall.controller;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;

import cn.e3.common.pojo.EasyUITreeNode;
import cn.e3mall.service.ItemCatService;

/**
 * 商品类别管理
 * @author Administrator
 *
 */
@Controller
public class ItemCatController {

	@Reference(timeout=5000000)
	private ItemCatService itemCatService;
	
	/**
	 * 通过parentId查询该条目下的所有子条目
	 * @param parentId
	 * @return
	 */
	@RequestMapping("/item/cat/list")
	@ResponseBody
	public List<EasyUITreeNode> getItemCatList(@RequestParam(value="id", defaultValue="0")Long parentId) {
		
		List<EasyUITreeNode> list = itemCatService.getItemCatList(parentId);
		return list;
	}
}
